<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2022/4/12
 * Time: 17:44
 */

namespace app\logic\index\example;


use app\logic\BaseLogic;

class ExampleLogic extends BaseLogic
{
    protected $model;

    protected static $instance;

    public function __construct()
    {
        parent::__construct();
        $this->model = new \app\model\example\ExampleModel();
    }

    public static function getInstance()
    {
//        if(is_object(self::$instance)){
//            return self::$instance;
//        }

        return  new self();
    }

    public function index($param)
    {
        $where = [
            'isdel'=>0,
            'status'=>1,
        ];

        $order = ['sort','asc'];

        $field = ['id','title','main_image','video_path','desc','sort'];

        $data = $this->model->index($where, $field, $order);
//        foreach($data['data'] as $val){
//            $val['link_url'] = $val['link_url'] ? $val['link_url'] : null;
//        }

        return $data;
    }
}